﻿'***************************************************************************\
' Module Name: AudioEndpointListItemControl.vb
' Project: SetDefaultAudioEndpoint http://sdae.codeplex.com/
' Copyright 2011 by jeff
' 
' This source is subject to the GNU General Public License version 2 (GPLv2).
' See http://www.gnu.org/licenses/gpl-2.0.html.
' All other rights reserved.
' 
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'***************************************************************************/

Imports System.Windows.Automation

Namespace Windows7

  Class AudioEndpointListItemControl
    Implements IAudioEndpoint

    Private ReadOnly myAudioEndpointAutomationElement As AutomationElement

    Public Sub New(ByVal audioEndpointAutomationElement As AutomationElement)
      Me.myAudioEndpointAutomationElement = audioEndpointAutomationElement
    End Sub

    Public ReadOnly Property Name() As String Implements IAudioEndpoint.Name
      Get
        Return Me.myAudioEndpointAutomationElement.Current.Name
      End Get
    End Property

    Public Sub SelectElement() Implements IAudioEndpoint.SelectElement
      Me.myAudioEndpointAutomationElement.SelectElement()
    End Sub
  End Class

End Namespace